/**
 * 
 */
package com.storm.lib.task;


import com.storm.lib.base.BaseTask;
import com.storm.lib.template.TimerTemplate;
import com.storm.lib.type.DateType;
import com.storm.lib.type.SystemType;
import com.storm.lib.type.TimerType;
import com.storm.lib.util.BeanUtil;
import com.storm.lib.util.DateUtil;

/**
 * 类功能: 定时器任务
 * @author johnny
 * @version 2010-11-25
 */
public class TimerTask extends BaseTask {
	
	private static TimerTemplate timerTemplate;
	
	@Override
	public void run() {
//		setRunState(SystemType.THREAD_STATE_RUN);
		timerTemplate.activePassedTimer(System.currentTimeMillis());
//		SystemStatusCache.executedTasks.remove(this);
//		setRunState(SystemType.THREAD_STATE_WAIT);
	}

	public TimerTask() {
		this.setRepeatDelayMS(DateUtil.getMSCount(DateType.TIME_TYPE_MS, 200));
		if(timerTemplate==null)
			timerTemplate = (TimerTemplate) BeanUtil.getBean("timerTemplate");
	}

}
